/*
 * Copyright 2011 John Alström
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package se.elva.slticket;

import android.app.LocalActivityManager;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;


public class UppsalaTabActivity extends TabActivity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// setContentView(R.layout.main);
		setContentView(R.layout.tablayout);
		try {
			LocalActivityManager adapter = new LocalActivityManager(UppsalaTabActivity.this,true);
			adapter.dispatchCreate(savedInstanceState);
			TabHost tabs = (TabHost) this.findViewById(android.R.id.tabhost);
			Intent intent1 = new Intent(UppsalaTabActivity.this, Uppsala.class);
				
			TabHost.TabSpec one = tabs.newTabSpec("one");
			one.setContent(intent1);
			one.setIndicator("Uppsala stadstrafik", this.getResources().getDrawable(
					R.drawable.ul_city));
			
			tabs.addTab(one);
			
			Intent intent = new Intent(UppsalaTabActivity.this, UppsalaRegion.class);
			TabHost.TabSpec two = tabs.newTabSpec("two");
			two.setContent(intent);
			//two.setContent(R.id.content2);	
			two.setIndicator("Uppsala Regionbussarna", this.getResources().getDrawable(
					R.drawable.ul_region));
			tabs.addTab(two);
		
			
			
			tabs.setCurrentTabByTag("one");
		} catch (Exception e) {
			System.out.println("Test");
		}
	}
}
